﻿Public Class ColorNumberArgVm
    Inherits ArgumentBaseVm

    Private Shared mColors As List(Of ColorInfo)

    Public ReadOnly Property ColorSet As List(Of ColorInfo)
        Get
            If mColors Is Nothing Then
                mColors = New List(Of ColorInfo)
                For i As Integer = 0 To 15
                    mColors.Add(New ColorInfo With {.Index = i,
                                                    .Name = TokenLib.ColorSet.ColorName(i),
                                                    .Color = AppData.Config.ColorSet.Color(i)})
                Next
            End If
            Return mColors
        End Get
    End Property

    Private mIsColorMenuOpen As Boolean
    Public Property IsColorMenuOpen As Boolean
        Get
            Return mIsColorMenuOpen
        End Get
        Set(value As Boolean)
            If mIsColorMenuOpen <> value Then
                mIsColorMenuOpen = value
                RaisePropertyChanged("IsColorMenuOpen")
            End If
        End Set
    End Property

    Public Overrides Property Value As String
        Get
            Return MyBase.Value
        End Get
        Set(value As String)
            IsColorMenuOpen = False
            MyBase.Value = value
        End Set
    End Property

    Public Class ColorInfo
        Public Property Index As Integer
        Public Property Name As String
        Public Property Color As System.Drawing.Color
    End Class
End Class
